import Vue from 'vue'
import VueRouter from 'vue-router'
import index from '../views/index.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:"/index"
  },
  {
    path:'/index',
    name:'index',
    component:index
  },
  {
    path:"/search",
    name:'search',
    component:()=>import("../views/search.vue")
  },
  {
    path:"/index/category",
    name:'category',
    component:()=>import("../components/index/category.vue")
  },
  {
    path:"/index/rank",
    name:'rank',
    component:()=>import("../components/index/rank.vue")
  },
  {
    path:"/index/newbook",
    name:'newbook',
    component:()=>import("../components/index/newbook.vue")
  },
  {
    path:"/index/endbook",
    name:'endbook',
    component:()=>import("../components/index/endbook.vue")
  },
  {
    path:"/index/welfare",
    name:'welfare',
    component:()=>import("../components/index/welfare.vue")
  },
  {
    path:"/base/bookdetail",
    name:'bookdetail',
    component:()=>import("../components/base/bookdetail.vue")
  },
  {
    path:"/base/bookcontent",
    name:'bookcontent',
    component:()=>import("../components/base/bookcontent.vue")
  },
  {
    path:"/index/categorydetail",
    name:'categorydetail',
    component:()=>import("../components/index/categorydetail.vue")
  },
  {
    path:"/index/bookshelf",
    name:'bookshelf',
    component:()=>import("../components/index/bookshelf.vue")
  },
  {
    path:"/index/info",
    name:'info',
    component:()=>import("../components/index/info.vue")
  },
  {
    path:"/index/signin",
    name:'signin',
    component:()=>import("../components/index/signin.vue")
  },
  {
    path:"/index/task",
    name:'task',
    component:()=>import("../components/index/task.vue")
  },
  {
    path:"/index/member",
    name:'member',
    component:()=>import("../components/index/member.vue")
  },
  {
    path:"/index/medal",
    name:'medal',
    component:()=>import("../components/index/medal.vue")
  },
  {
    path:"/base/booklist",
    name:'booklist',
    component:()=>import("../components/base/booklist.vue")
  },
]

const router = new VueRouter({
  routes
})

export default router
